package com.ybdz.scanner.utils;

import com.ybdz.scanner.bean.LuKuBean;
import com.ybdz.scanner.bean.chuKuBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by gs on 2018/3/20.
 */

public class ListUtil {

    private static List<LuKuBean> LukuList = new ArrayList<>();
    private static List<chuKuBean> chuKuList = new ArrayList<>();

    /*添加到集合
    **/
    public static void addLuKuList(LuKuBean ben){
        if (LukuList == null){
            LukuList = new ArrayList<>();
        }
        LukuList.add(ben);
    }


    /*获取集合*/
    public static List<LuKuBean> getLuKuList(){
        return LukuList;
    }


    //出库集合；
    public static void addChuKuList(chuKuBean ben){
        if (chuKuList == null){
            chuKuList = new ArrayList<>();
        }
        chuKuList.add(ben);
    }

    public static List<chuKuBean> getChuKuList(){
        return chuKuList;
    }



    /*清空集合
    **/
    private static void cleanLuKuList(){
        if (LukuList != null){
            LukuList.clear();
            LukuList =null;
        }
    }

    public static void cleanChuKUList(){
        if (chuKuList != null){
            chuKuList.clear();
            chuKuList = null;
        }
    }

    //出入库单号
    private static String inputFormCode ="";
    private static String outFormCode ="";

    public static String getInputFormCode() {
        return inputFormCode;
    }

    public static void setInputFormCode(String inputFormCode2) {
        if (inputFormCode.length() >0 && !inputFormCode.equals(inputFormCode2)){
            ListUtil.cleanLuKuList();
        }
        ListUtil.inputFormCode = inputFormCode2;

    }

    public static String getOutFormCode() {
        return outFormCode;
    }

    public static void setOutFormCode(String outFormCode) {
        ListUtil.outFormCode = outFormCode;
    }
}
